package cn.lotusnut.rabbitmqboot.controller;

import cn.lotusnut.rabbitmqboot.dead.DeadProvider;
import cn.lotusnut.rabbitmqboot.delay.DelayProvider;
import cn.lotusnut.rabbitmqboot.direct.DirectProvider;
import cn.lotusnut.rabbitmqboot.publish.PublishProvider;
import cn.lotusnut.rabbitmqboot.simple.SimpleProvider;
import cn.lotusnut.rabbitmqboot.topic.TopicProvider;
import cn.lotusnut.rabbitmqboot.work.WorkProvider;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author JiangMing Zhou
 * @Date 2022/12/1 14:28
 * @Version 1.8
 */
@RestController
@RequestMapping("/rabbitmq")
public class RabbitmqController {

    @Resource
    private SimpleProvider simpleProvider;

    @Resource
    private WorkProvider workProvider;

    @Resource
    private PublishProvider publishProvider;

    @Resource
    private DirectProvider directProvider;

    @Resource
    private TopicProvider topicProvider;

    @Resource
    private DeadProvider deadProvider;

    @Resource
    private DelayProvider delayProvider;


    @GetMapping("/simple")
    public void simple(String message){
        simpleProvider.sendMessage(message);
    }

    @GetMapping("/work")
    public void work(String message){
        workProvider.sendMessage(message);
    }

    @GetMapping("/publish")
    public void publish(String message){
        publishProvider.sendMessage(message);
    }

    @GetMapping("/direct")
    public void direct(String message){
        directProvider.sendMessage(message);
    }

    @GetMapping("/topic")
    public void topic(String message){
        topicProvider.sendMessage(message);
    }

    @GetMapping("/dead")
    public void dead(String message){
        deadProvider.sendMessage(message);
    }

    @GetMapping("/delay")
    public void delay(String message,Integer delayTime){
        delayProvider.sendMessage(message,delayTime);
    }
}
